package com.atguigu.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.kerby.config.Conf;
import org.junit.Test;

import java.io.IOException;

public class HDFSDemo2 {
    @Test
    public void test() throws IOException {
        Configuration conf = new Configuration();
        conf.set("fs.defaultFS","hdfs://hadoop102:9820");
        //conf.set("dfs.replication","2");
        FileSystem fs = FileSystem.get(conf);
        fs.copyFromLocalFile(false,true,new Path("D:\\io\\1.txt"),
                new Path("/hdfs/"));

    }
}
